<?php

/**
 * staticinfomation filter form base class.
 *
 * @package    nutrition
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedInheritanceTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BasestaticinfomationFormFilter extends infomationFormFilter
{
  protected function setupInheritance()
  {
    parent::setupInheritance();

    $this->widgetSchema   ['alias_name'] = new sfWidgetFormFilterInput();
    $this->validatorSchema['alias_name'] = new sfValidatorPass(array('required' => false));

    $this->widgetSchema   ['user_id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('user'), 'add_empty' => true));
    $this->validatorSchema['user_id'] = new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('user'), 'column' => 'id'));

    $this->widgetSchema   ['groups'] = new sfWidgetFormChoice(array('choices' => array('' => '', '关于学会' => '关于学会', '政策法规' => '政策法规')));
    $this->validatorSchema['groups'] = new sfValidatorChoice(array('required' => false, 'choices' => array('关于学会' => '关于学会', '政策法规' => '政策法规')));

    $this->widgetSchema->setNameFormat('staticinfomation_filters[%s]');
  }

  public function getModelName()
  {
    return 'staticinfomation';
  }

  public function getFields()
  {
    return array_merge(parent::getFields(), array(
      'alias_name' => 'Text',
      'user_id' => 'ForeignKey',
      'groups' => 'Enum',
    ));
  }
}
